var express = require('express');
var router = express.Router();
var socket_map = require('../models/analysis.js')._socket_map;
var send = require('../models/send.js');
/* GET home page. */
router.get('/', function(req, res) {
  res.render('index', { title: 'Express' });
});

router.post('/', function(req, res){
  send.ask_all(req.data.sim,socket_map[req.data.sim],function(msg){
    res.json(msg);
  });
});

router.put('/', function(req, res){
  send.set_para(req.data.sim,req.data.name,req.data.value,socket_map[req.data.sim],function(msg){
    res.json(msg);
  });
});

module.exports = router;
